package main

import (
	"fmt"
	"reflect"
)

type User05 struct {
	Id   int
	Name string
	Age  int
}

func main() {
	var num = 1.2
	var user = User05{}
	var s = []int{1, 2, 4}
	//通过值信息获得归属类型分类
	fmt.Println(reflect.ValueOf(num).Kind())
	fmt.Println(reflect.TypeOf(num).Kind())
	fmt.Println(reflect.ValueOf(user).Kind())
	fmt.Println(reflect.TypeOf(user).Kind())
	fmt.Println(reflect.ValueOf(s).Kind())
	fmt.Println(reflect.TypeOf(s).Kind())

	//通过值信息指针，获得变量信息
	fmt.Println(reflect.ValueOf(&num).Elem())
	fmt.Println(reflect.ValueOf(&user).Elem())
	fmt.Println(reflect.ValueOf(&s).Kind())
}
